package com.zhou.common.mybatis.template.shiro.zhou.entity;

import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;


public class UserCenterAuthenticationToken extends AbstractAuthenticationToken {

    private Object principal;

    private Object token;

    public UserCenterAuthenticationToken(){
        super(null);
    }

    public UserCenterAuthenticationToken(Object principal,Object token){
        super(null);
        this.principal=principal;
        this.token=token;
        super.setAuthenticated(true); // must use super, as we override

    }

    public UserCenterAuthenticationToken(Object principal, Object token,
                                               Collection<? extends GrantedAuthority> authorities) {
        super(authorities);
        this.principal = principal;
        this.token = token;
        super.setAuthenticated(true); // must use super, as we override
    }


    @Override
    public Object getCredentials() {
        return "";
    }

    @Override
    public Object getPrincipal() {
        return principal;
    }

    public void setPrincipal(Object principal) {
        this.principal = principal;
    }

    public Object getToken() {
        return token;
    }

    public void setToken(Object token) {
        this.token = token;
    }
}
